﻿<UserControl x:Class="Smokey.Client.Screens.Common.ConnectionStringSetup"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d"
             x:ClassModifier="internal">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition
                Height="*"/>
        </Grid.RowDefinitions>
        
        <StackPanel>
        <TextBlock
            Text="Set Up Local Database"
            Style="{StaticResource TitleStyle}"/>

            <TextBlock
            Text="Smokey requires a SQL Server database in order to store information about applications. A connection string was either not found in the app.config or was incorrect."
            Style="{StaticResource LabelStyle}"/>
            
            <TextBlock
                Text="{Binding ErrorMessage}"
                Style="{StaticResource WarningStyle}"/>
            
            <TextBlock
                Text="Server"
                Style="{StaticResource LabelStyle}"/>
            
            <TextBox
                Text="{Binding Server}"
                Width="200"
                HorizontalAlignment="Left" 
                Margin="0,10,0,0"/>
            
            <TextBlock
                Text="Database Name"
                Style="{StaticResource LabelStyle}"/>
            
            <TextBox
                Text="{Binding DatabaseName}"
                Width="200"
                HorizontalAlignment="Left"
                Margin="0,10,0,0"/>
            
            <Button
                Content="Save"
                HorizontalAlignment="Left"
                Margin="0,10,0,0"
                Style="{StaticResource ButtonStyle}"
                Click="SaveButton_Click"/>
        </StackPanel>
        
    </Grid>
</UserControl>
